#!usr/bin/node

const Dog = require("./02-dog.js");

const jingba = new Dog("jingba",8);
const taidi = new Dog("taidi",5);

jingba.on("bark",onbark);
taidi.on("bark",onbark);

function onbark(name,energy) {
  console.log(`${name} ${energy}`);
}
